package cn.ai.boot.config2;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author jie.zhao@dms365.com
 * @Date 2025/7/9 11:19
 */
public class Test3 {

    private static final String ETL_PK_SHOW = "ec_etl_id_pk-show";

    public static void main(String[] args) {
        String receiveWriteSuffix = "校验";
        List<Map<String, Object>> dmuDetails = new ArrayList<>();
        Map<String, Object> dmu1 = new HashMap<>();
        dmu1.put(ETL_PK_SHOW, "校验-bak");
        dmuDetails.add(dmu1);

        Map<String, Object> dmu2 = new HashMap<>();
        dmu2.put(ETL_PK_SHOW, "校验-22");
        dmuDetails.add(dmu2);


        Map<String, Object> dmu4 = new HashMap<>();
        dmu4.put(ETL_PK_SHOW, "校验");
        dmuDetails.add(dmu4);
        Map<String, Object> dmuMap = dmuDetails.stream().filter(dmu -> dmu.get(ETL_PK_SHOW) != null
                && dmu.get(ETL_PK_SHOW).toString().endsWith(receiveWriteSuffix)).findFirst().orElse(null);

        System.out.println(dmuMap);
    }
}
